import QtQuick 1.1
import com.nokia.meego 1.0

Rectangle {
    id: progress
    property alias minimumValue: pb.minimumValue
    property alias maximumValue: pb.maximumValue
    property alias value: pb.value
    property int precision: 2
    signal clicked

    function toFixed(value) {
        var number = new Number(value)
        return number.toFixed(precision)
    }
    color: "transparent"

    ProgressBar {
        id: pb
        anchors.verticalCenter: parent.verticalCenter
        anchors.left: parent.left
        anchors.right: progText.left
        minimumValue: 0
        maximumValue: 100
        value: 50
    }
    Text {
        id: progText
        anchors.verticalCenter: parent.verticalCenter
        anchors.right: parent.right
        font.pixelSize: 15
        text: toFixed(pb1.value)+ "%"
    }

    MouseArea {
        anchors.fill: parent
        onClicked: {
            progress.clicked()
        }
    }
}
